package com.example.takeaway.serivce.impl;

import com.example.takeaway.entity.Address;
import com.example.takeaway.mapper.AddressMapper;
import com.example.takeaway.serivce.IAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * addressService业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-08
 */
@Service
public class AddressServiceImpl implements IAddressService
{
    @Autowired
    private AddressMapper addressMapper;

    /**
     * 查询address
     * 
     * @param addressid address主键
     * @return address
     */
    @Override
    public Address selectAddressByAddressid(Long addressid)
    {
        return addressMapper.selectAddressByAddressid(addressid);
    }

    /**
     * 查询address列表
     * 
     * @param address address
     * @return address
     */
    @Override
    public List<Address> selectAddressList(Address address)
    {
        return addressMapper.selectAddressList(address);
    }

    /**
     * 新增address
     * 
     * @param address address
     * @return 结果
     */
    @Override
    public int insertAddress(Address address)
    {
        return addressMapper.insertAddress(address);
    }

    /**
     * 修改address
     * 
     * @param address address
     * @return 结果
     */
    @Override
    public int updateAddress(Address address)
    {
        return addressMapper.updateAddress(address);
    }

    /**
     * 批量删除address
     * 
     * @param addressids 需要删除的address主键
     * @return 结果
     */
    @Override
    public int deleteAddressByAddressids(Long[] addressids)
    {
        return addressMapper.deleteAddressByAddressids(addressids);
    }

    /**
     * 删除address信息
     * 
     * @param addressid address主键
     * @return 结果
     */
    @Override
    public int deleteAddressByAddressid(Long addressid)
    {
        return addressMapper.deleteAddressByAddressid(addressid);
    }
}
